/* jshint indent: 1 */

module.exports = function(sequelize, DataTypes) {
	return sequelize.define('wxAccess', {
		access_id: {
			type: DataTypes.BIGINT,
			allowNull: false,
			primaryKey: true,
			autoIncrement: true
		},
		access_token: {
			type: DataTypes.STRING,
			allowNull: true
		},
		refresh_token: {
			type: DataTypes.STRING,
			allowNull: true
		},
		gmt_expire: {
			type: DataTypes.DATE,
			allowNull: true
		},
		subscribe: {
			type: DataTypes.INTEGER(11),
			allowNull: true
		},
		group_id: {
			type: DataTypes.INTEGER(11),
			allowNull: true
		},
		wx_user_img: {
			type: DataTypes.STRING,
			allowNull: true
		},
		wx_nick_name: {
			type: DataTypes.STRING,
			allowNull: true
		},
		unionid: {
			type: DataTypes.STRING,
			allowNull: true
		},
		openid: {
			type: DataTypes.STRING,
			allowNull: true
		},
		wx_sex: {
			type: DataTypes.INTEGER(11),
			allowNull: true
		},
		country: {
			type: DataTypes.STRING,
			allowNull: true
		},
		province: {
			type: DataTypes.STRING,
			allowNull: true
		},
		city: {
			type: DataTypes.STRING,
			allowNull: true
		},
		wx_language: {
			type: DataTypes.STRING,
			allowNull: true
		},
		gmt_create: {
			type: DataTypes.DATE,
			allowNull: false
		},
		gmt_modified: {
			type: DataTypes.DATE,
			allowNull: false
		}
	}, {
		tableName: 'f_wx_access',
		timestamps: false,
		freezeTableName: false
	});
};
